﻿<%@ Page Language="VB" MasterPageFile="~/HelpDesk.master" AutoEventWireup="false"
    CodeFile="DocTechnique.aspx.vb" Inherits="Admin_DocTechnique" Title="Documentation technique"
    Theme="HelpDesk" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1>
        <asp:Literal ID="Literal1" runat="server" meta:resourcekey="Literal1Resource1" Text="Documentation technique"></asp:Literal>
    </h1>
    <table width="100%">
        <tr>
            <td width="50%">
                <asp:HyperLink ID="LienNouvelleDoc" runat="server" NavigateUrl="~/Admin/DocTechniqueForm.aspx"
                    meta:resourcekey="LienNouvelleDocResource1">
                    <img src="../Images/Icones/book_add.png" alt="Nouvelle documentation" />
                    Nouvelle documentation
                </asp:HyperLink>
            </td>
            <td align="right" width="50%">
                <asp:SqlDataSource ID="SqlClients" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
                    SelectCommand="SELECT [entreprise_id], [entreprise_nom] FROM [Entreprise] ORDER BY [entreprise_nom]">
                </asp:SqlDataSource>
                <asp:DropDownList ID="DropDownListClients" runat="server" AutoPostBack="True" DataSourceID="SqlClients"
                    DataTextField="entreprise_nom" DataValueField="entreprise_id" AppendDataBoundItems="True"
                    meta:resourcekey="DropDownListClientsResource1">
                    <asp:ListItem Value="" Text="----- Client -----" meta:resourcekey="ListItemResource1"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDoc" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskCS %>"
        SelectCommand="SELECT DocTechnique.doctechnique_id, DocTechnique.doctechnique_sujet, Entreprise.entreprise_nom FROM DocTechnique INNER JOIN Entreprise ON DocTechnique.entreprise_id = Entreprise.entreprise_id WHERE (DocTechnique.entreprise_id = CASE WHEN @entreprise_id IS NULL THEN DocTechnique.entreprise_id ELSE @entreprise_id END) ORDER BY DocTechnique.doctechnique_sujet"
        CancelSelectOnNullParameter="False">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownListClients" Name="entreprise_id" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridViewDoc" runat="server" AutoGenerateColumns="False" DataKeyNames="doctechnique_id"
        DataSourceID="SqlDoc" meta:resourcekey="GridViewDocResource1">
        <Columns>
            <asp:TemplateField HeaderText="Sujet" SortExpression="doctechnique_sujet" meta:resourcekey="TemplateFieldResource1">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLinkEdit" runat="server" NavigateUrl='<%# Eval("doctechnique_id", "DocTechniqueForm.aspx?doctechnique_id={0}") %>'
                        meta:resourcekey="HyperLinkEditResource1">
                    <img src="../Images/Icones/book_edit.png" alt="Modifier" />
                    </asp:HyperLink>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("doctechnique_id", "DocTechniqueForm.aspx?doctechnique_id={0}") %>'
                        Text='<%# Eval("doctechnique_sujet") %>' meta:resourcekey="HyperLink1Resource1"></asp:HyperLink>
                </ItemTemplate>
                <HeaderStyle Width="50%" />
            </asp:TemplateField>
            <asp:BoundField DataField="entreprise_nom" HeaderText="Client" SortExpression="entreprise_nom"
                meta:resourcekey="BoundFieldResource1" />
        </Columns>
    </asp:GridView>
</asp:Content>
